//package com.faner.fast.config;
//
//import lombok.Data;
//import org.apache.commons.lang3.StringUtils;
//import org.redisson.Redisson;
//import org.redisson.config.Config;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.PropertySource;
///**
// * description: RedissonConfig
// * date: 2020/12/4 11:08
// * author: faner
// */
//@Data
//@Configuration
//@ConfigurationProperties(prefix = "spring.redis")
//@PropertySource("classpath:application.yml")
//public class RedissonConfig {
//    private String host;
//    private String port;
//    private String password;
//    private int database;
//
//    @Bean
//    public Redisson getRedisson(){
//        Config config = new Config();
//        config.useSingleServer().setAddress("redis://" + host + ":" + port).setDatabase(database);
//        if(StringUtils.isNotBlank(password)){
//            config.useSingleServer().setPassword(password);
//        }
//        return (Redisson)Redisson.create(config);
//    }
//}
